import App from './App'

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'

// main.js
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)

/* 跳转 */
import $pub from '@/utils/pub.js'
Vue.prototype.$pub = $pub;

// new Api
import * as API from '@/api/index.js'
console.log(API, "API");
Vue.prototype.$API = API
import store from '@/store/index.js'
Vue.prototype.$store = store
/* router */
import {
	router,
	RouterMount
} from './router/router.js' //路径换成自己的
Vue.use(router)


/* lin-ui */
// import lin from '@/node_'



/* webSocket */
let token = uni.getStorageSync('token');
let url = `wss://api.imquanzi.com/ws?token=${token}`;
/* 连接websocket */
// console.log(1);
// Vue.prototype.$store.dispatch('websocket/WEBSOCKET_INIT', url);

// this.$store.dispatch('WEBSOCKET_INIT', 'websocket ip')
// this.$store.dispatch('WEBSOCKET_SEND', '发送的数据')
// this.$store.dispatch('CLOSE_SOCKET')
import socketIO from '@/utils/websocket.js'
Vue.prototype.$socketIo = new socketIO()



/* 胶囊高度 */
// import mixin from '@/mixin.js'
// Vue.mixin(mixin)



/* 自定义组件 */
import viewNavbar from '@/components/navBar.vue';
Vue.component('view-navbar', viewNavbar); // 注册组件

import danHthreeDrawer from '@/components/danH-threeDrawer/danH-threeDrawer.vue';
Vue.component('danH-threeDrawer', danHthreeDrawer); // 注册组件

import loader from '@/components/image-loader/image-loader.vue';
Vue.component('imageload', loader); // 注册组件

// import mpweixin from '@/components/mp-weixin/index.vue';
// Vue.component('mp-weixin', mpweixin); // 注册组件



/* 地图 */
// 引入SDK核心类，js文件根据自己业务，位置可自行放置
// import QQMapWX from '@/utils/qqmap-wx-jssdk.min.js';

// 实例化API核心类
// Vue.prototype.$qqmapsdk = new QQMapWX({
// 	key: '5LGBZ-DD3L3-QXC35-3CR45-7RKZT-FFBW6'
// });
// console.log(Vue.prototype.$qqmapsdk, 'QQMapWX111');



const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif